package protocol;

/**
 * <p>类描述</p>

 * @author zhuqi
 * @since 2023/3/14 13:13
 */
public enum MessageClassEnum {


	;


	private Integer code;

	private Class clazz ;

	MessageClassEnum(Integer code, Class clazz) {
		this.code = code;
		this.clazz = clazz;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public Class getClazz() {
		return clazz;
	}

	public void setClazz(Class clazz) {
		this.clazz = clazz;
	}

	public static Class getClassByCode(Integer code) {
		MessageClassEnum[] values = MessageClassEnum.values();
		for (MessageClassEnum value : values) {
			if (value.getCode().compareTo(code) == 0) {
				return value.getClazz();
			}
		}
		return null;
	}
}
